package 笔试.秋招2023.同盾科技.T2;

import java.util.HashMap;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        //输入数组
        Scanner sc = new Scanner(System.in);
        int length = sc.nextInt();
        HashMap<Integer, Integer> map = new HashMap<>();
        if (sc.hasNextInt()) {
            for (int i = 0; i < length; i++) {
                int input = sc.nextInt();
                int value;
                //出现次数大于等于数组长度一半的
                if (!map.containsKey(input)) {
                    value = 1;
                } else {
                    value = map.get(input) + 1;
                }
                map.put(input, value);
            }
        }

        map.forEach((k, v) -> {
            if (length % 2 != 0) {
                if (v >= ((length / 2) + 1)) {
                    System.out.println(k);
                }
            } else {
                if (v >= ((length / 2))) {
                    System.out.println(k);
                }
            }
        });
    }
}
